package com.escool.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.escool.dao.AlumnoDAO;
import com.escool.model.TbAlumno;
@Service
public class AlumnoServiceImpl implements AlumnoService {
	
	@Autowired
	AlumnoDAO alumnoDAO;

	@Transactional
	public void add(TbAlumno alumno) {
		alumnoDAO.add(alumno);

	}

	@Transactional
	public void edit(TbAlumno alumno) {
		alumnoDAO.edit(alumno);

	}

	@Transactional
	public void delete(Integer id) {
		alumnoDAO.delete(id);

	}

	@Transactional
	public List<TbAlumno> listAll() {
		
		return alumnoDAO.listAll();
	}

	@Transactional
	public TbAlumno find(Integer id) {
		
		return alumnoDAO.find(id);
	}

	@Transactional
	public List<TbAlumno> listByResponsable(Integer id) {
		
		return alumnoDAO.listByResponsable(id);
	}
	
	@Transactional
	public List<TbAlumno> listByCodigo(String cod) {
		// TODO Auto-generated method stub
		return alumnoDAO.listByCodigo(cod);
	}

}
